package cn.kxm.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.kxm.dao.ParttypeDetailMapper;
import cn.kxm.pojo.PartType;
import cn.kxm.pojo.ParttypeDetail;
import cn.kxm.service.ParttypeDetailService;
@Service
public class ParttypeDetailServiceImpl implements ParttypeDetailService{

	@Autowired
	private ParttypeDetailMapper pm;

	@Override
	public List<Map<String, Object>> getall(Integer pname, Integer ptid,
			Integer page, Integer size) {
		// TODO Auto-generated method stub
		return pm.getall(pname, ptid, page, size);
	}

	@Override
	public int getCount(Integer pname, Integer ptid) {
		// TODO Auto-generated method stub
		return pm.getCount(pname, ptid);
	}

	@Override
	public int getid() {
		// TODO Auto-generated method stub
		return pm.getid();
	}

	@Override
	public int add(PartType p) {
		// TODO Auto-generated method stub
		return pm.add(p);
	}

	@Override
	public int adddetail(ParttypeDetail pd) {
		// TODO Auto-generated method stub
		return pm.adddetail(pd);
	}

	@Override
	public boolean adddouble(PartType p, ParttypeDetail pd) {
		// TODO Auto-generated method stub
		if(pm.add(p)>0&&pm.adddetail(pd)>0){
			return true;
		}
		return false;
	}

	@Override
	public Map<String, Object> getoneById(Integer id) {
		// TODO Auto-generated method stub
		return pm.getoneById(id);
	}

	@Override
	public int update(PartType p) {
		// TODO Auto-generated method stub
		return pm.update(p);
	}

	@Override
	public int updatedetail(ParttypeDetail pd) {
		// TODO Auto-generated method stub
		return pm.updatedetail(pd);
	}

	@Override
	public boolean updatedouble(PartType p, ParttypeDetail pd) {
		if(pm.update(p)>0&&pm.updatedetail(pd)>0){
			return true;
		}
		return false;
	}

	@Override
	public List<PartType> getlist() {
		// TODO Auto-generated method stub
		return pm.getlist();
	}

	@Override
	public int del(String id) {
		// TODO Auto-generated method stub
		return pm.del(id);
	}

	@Override
	public int deldetail(String ptid) {
		// TODO Auto-generated method stub
		return pm.deldetail(ptid);
	}

	@Override
	public boolean deldouble(String id) {
		if(deldetail(id)>0&&del(id)>0){
			return true;
		}
		return false;
	}

	@Override
	public List<Integer> getarray() {
		// TODO Auto-generated method stub
		return pm.getarray();
	}

}
